package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipRepairStepService;
import cc.comac.mom.bean.EquipRepair;
import cc.comac.mom.bean.EquipRepairStep;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/EquipRepairStep")
public class EquipRepairStepController {

	@Autowired
	private  EquipRepairStepService equipRepairStepService;
	
	@ApiOperation("批量插入维修步骤")
	@RequestMapping(value = "/insertBatch",method = RequestMethod.POST)
	public ResultBean insertBatch(@RequestBody List<EquipRepairStep> list) {
		return equipRepairStepService.insertBatch(list);
	}
	
	@ApiOperation("修改维修步骤")
	@RequestMapping(value = "/update",method = RequestMethod.POST)
	public ResultBean update(@RequestBody EquipRepairStep obj) {
		return equipRepairStepService.update(obj);
	}
	
	@ApiOperation("批量删除维修步骤")
	@RequestMapping(value = "/deleteBatch",method = RequestMethod.POST)
	public ResultBean deleteBatch(@RequestBody List<EquipRepairStep> list) {
		return equipRepairStepService.deleteBatch(list);
	}
	
	@ApiOperation("上移维修步骤")
	@RequestMapping(value = "/moveUp",method = RequestMethod.POST)
	public ResultBean moveUp(@RequestBody EquipRepairStep obj) {
		return equipRepairStepService.moveUp(obj);
	}
	
	@ApiOperation("下移维修步骤")
	@RequestMapping(value = "/moveDown",method = RequestMethod.POST)
	public ResultBean moveDown(@RequestBody EquipRepairStep obj) {
		return equipRepairStepService.moveDown(obj);
	}
	
	@ApiOperation("查询维修步骤")
	@RequestMapping(value = "/selectByCondition",method = RequestMethod.POST)
	public ResultBean selectByCondition(@RequestBody EquipRepairStep obj) {
		return equipRepairStepService.selectByCondition(obj);
	}
	
	@ApiOperation("获取维修知识库维修步骤")
	@RequestMapping("/getRepqirRepositoryStepInfo")
	public ResultBean getRepqirRepositoryStepInfo(@RequestBody EquipRepair obj) {
		return equipRepairStepService.getRepqirRepositoryStepInfo(obj);
	}
}
